package UserInterface;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;

public class FinishRechargeMobile extends JPanel {
	JButton btnOk;
	JLabel lblPhoneNumber;
	JLabel lblTrasferAmount;
	JLabel labelBalance;
	
	public void setOkListener(ActionListener list){
		btnOk.addActionListener(list);
	}
	
	public void setPhoneNumber(String phone){
		lblPhoneNumber.setText(phone);
	}
	
	public void setAmountToTransfer(String amount){
		 lblTrasferAmount.setText(amount);
	}
	
	public void setBalance(String balance){
		labelBalance.setText(balance);
	}

	/**
	 * Create the panel.
	 */
	public FinishRechargeMobile() {
		setBackground(new Color(255, 248, 220));
		this.setSize(500, 500);
		
		JLabel lblNumberPhone = new JLabel("Phone number:");
		lblNumberPhone.setForeground(new Color(128, 0, 0));
		lblNumberPhone.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		lblPhoneNumber = new JLabel("");
		lblPhoneNumber.setFont(new Font("Arial", Font.BOLD, 18));
		
		JLabel lblYourBalance = new JLabel("Your Balance:");
		lblYourBalance.setForeground(new Color(128, 0, 0));
		lblYourBalance.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		labelBalance = new JLabel("");
		labelBalance.setFont(new Font("Arial", Font.BOLD, 18));
		
	    btnOk = new JButton("Ok");
		btnOk.setFont(new Font("Tahoma", Font.BOLD, 14));
		
		JLabel lblAmontToTransfer = new JLabel("Amont to transfer:");
		lblAmontToTransfer.setForeground(new Color(128, 0, 0));
		lblAmontToTransfer.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		 lblTrasferAmount = new JLabel("");
		lblTrasferAmount.setFont(new Font("Arial", Font.BOLD, 18));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap(172, Short.MAX_VALUE)
					.addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
					.addGap(164))
				.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()
					.addGap(25)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblNumberPhone)
						.addComponent(lblYourBalance, GroupLayout.PREFERRED_SIZE, 148, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblAmontToTransfer, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE))
					.addGap(77)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(labelBalance, GroupLayout.PREFERRED_SIZE, 172, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblPhoneNumber)
						.addComponent(lblTrasferAmount, GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE))
					.addContainerGap())
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap(118, Short.MAX_VALUE)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNumberPhone)
						.addComponent(lblPhoneNumber))
					.addGap(34)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblAmontToTransfer, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTrasferAmount, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))
					.addGap(36)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblYourBalance, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
						.addComponent(labelBalance, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))
					.addGap(123)
					.addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
					.addGap(89))
		);
		setLayout(groupLayout);
	}
}
